#pragma once

#include <string>
#include <set>
#include <functional>
#include "Singleton.h"
#include "MsgRouter.h"
#include "1300_user_info.pb.h"

class UserService
{
public:
    bool Init();

public:
    UserService() = default;
    virtual ~UserService() = default;

public:
    static UserService* Instance()
	{
		return CSingleton<UserService>::Instance();
	}

public:
    enum Sence
    {
        SHARE_POSTER = 100,
        NOTIFY = 101,
        MAIL = 102,
    };
public:
    bool HandleGetUserinfo(const std::uint32_t& uid, std::string&& trans, Sence sence);
    void OnUserinfoGet(MsgData&& data);
    inline void ListenOnUserinfoGet(Sence sence, std::function<void(client_proto::GetUserBasicInfoResp& p_resp)> listen)
    {
        m_userinfo_get_listen[sence] = listen;
    }
private:
    std::map<Sence, std::function<void(client_proto::GetUserBasicInfoResp& p_resp)>> m_userinfo_get_listen;

};










